/**
 * 
 */
package de.sinnlosimnetz.forum.util;

import java.lang.reflect.InvocationTargetException;

/**
 * @author Henning D
 *
 */
public class ExceptionUtil
{
	public static Exception generateException(Exception e, String message)
	{
		Exception ex = null;;
		try
		{
			ex = e.getClass().getConstructor(new Class[]{String.class}).newInstance(new Object[]{message});
			ex.initCause(e);
		}
		catch (IllegalArgumentException e1)
		{
			e1.printStackTrace();
		}
		catch (SecurityException e1)
		{
			e1.printStackTrace();
		}
		catch (InstantiationException e1)
		{
			e1.printStackTrace();
		}
		catch (IllegalAccessException e1)
		{
			e1.printStackTrace();
		}
		catch (InvocationTargetException e1)
		{
			e1.printStackTrace();
		}
		catch (NoSuchMethodException e1)
		{
			e1.printStackTrace();
		}
		return ex;
	}
}
